package kr.co.doriclassic.workhischool.dto;

public class Student {
	private int stdno;
	private String stdname;
	private int kor;
	private int eng;
	private int math;
	public Student() {
	}
	public Student(int stdno, String stdname) {
		this.stdno = stdno;
		this.stdname = stdname;
	}
	public Student(int stdno, String stdname, int kor, int eng, int math) {
		this.stdno = stdno;
		this.stdname = stdname;
		this.kor = kor;
		this.eng = eng;
		this.math = math;
	}
	public int getStdno() {
		return stdno;
	}
	public void setStdno(int stdno) {
		this.stdno = stdno;
	}
	public String getStdname() {
		return stdname;
	}
	public void setStdname(String stdname) {
		this.stdname = stdname;
	}
	public int getKor() {
		return kor;
	}
	public void setKor(int kor) {
		this.kor = kor;
	}
	public int getEng() {
		return eng;
	}
	public void setEng(int eng) {
		this.eng = eng;
	}
	public int getMath() {
		return math;
	}
	public void setMath(int math) {
		this.math = math;
	}
	public int totalScore(){
		return kor+eng+math;
	}
	public double averageSocre(){
		return totalScore()/3.0;
	}
	@Override
	public String toString() {
		return String
				.format("%5s\t%10s\t%5s\t%5s\t%5s\t%s\t%5s",
						stdno, stdname, kor, eng, math, totalScore(),
						averageSocre());
	}
}
